package com.xbongbong.saas.service.impl;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.pro.message.enums.PushTypeEnum;
import com.xbongbong.pro.message.pojo.dto.MessageRabbitMqDTO;
import com.xbongbong.pro.rabbitmq.producer.AIProducer;
import com.xbongbong.saas.service.AIReceiveMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Description: 消息接收处理类
 * @Author: jiping.yang
 * @Date: 2022-09-23  14:07
 * @version: v1.0
 **/
@Service("aiReceiveMessageService")
public class AIReceiveMessageServiceImpl implements AIReceiveMessageService {

    @Resource
    private AIProducer aiProducer;

    @Override
    public String receiveMessage(MessageRabbitMqDTO messageRabbitMqDTO, PushTypeEnum pushTypeEnum) throws XbbException {
        aiProducer.sendMessage(messageRabbitMqDTO, pushTypeEnum);
        return "success";
    }
}
